package com.bc.service.deal.BtcChina;

import java.io.IOException;

import android.content.Context;

import com.bc.service.GenericService;
import com.bc.service.SimpleRequestListener;
import com.bc.service.deal.BtcCategory;
import com.bc.service.deal.ServiceCategory;
import com.bc.service.deal.Btc100.Btc100Request;
import com.bc.service.deal.QJLfutures.QJLfuturesResponse.Ticker;

/**
 * 比特币中国
 * @author ywen
 *
 */
public class BtcChinaService extends GenericService<BtcChinaRequest, BtcChinaResponse> implements ServiceCategory{

	public BtcChinaService(Context context) {
		super(context);
	}

	public Ticker getBtcChinaTickers() {
		return mResponse == null ? null : mResponse.ticker;
	}
	
	@Override
	protected void onRequest(int requestCode, BtcChinaRequest request) {
		
	}

	@Override
	protected void onResponse(int requestCode, BtcChinaRequest request,
			BtcChinaResponse response) throws IOException {
		
	}

	@Override
	public void loadBtcData(SimpleRequestListener listener) {
		setRequest(new BtcChinaRequest());
		request(REQUEST_CODE_LOAD, listener);	
	}

	@Override
	public BtcCategory getServieResponse() {
		return mResponse;
	}

	@Override
	public void cancelLoading() {
		super.cancel();
	}

}
